package com.fjzx.androidframe.network.entity;

import com.fjzx.androidframe.network.ResponseMap;

/**
 * 基础Http请求返回数据
 *
 * @param <T>
 * @author xiongyongcong
 */
public class BaseResponse<T> {
    /**
     * 数据
     **/
    private T data;
    /**
     * 返回类型
     **/
    private int code;
    /**
     * 返回消息
     **/
    private String message;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccessful() {
        return code == ResponseMap.OK || code == ResponseMap.SUCCESS;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
